# the next line sets up include and link directories and defines some variables that we will use.
# you can modify the behavior by setting some variables, e.g.
#   set(QT_USE_OPENGL TRUE)
# -> this will cause cmake to include and link against the OpenGL module

include(${QT_USE_FILE})
include("PCHSupport")

include_directories( "../" "./" )

include_directories( ${EXPE_CORE_INCLUDES} )

# the variable "qtproject_SRCS" contains all .cpp files of this project
set(ExpeCore_src

    Math/ExpeRgba.cpp
    Math/ExpeMath.cpp
    Math/ExpeVector2.cpp
    Math/ExpeVector3.cpp
    Math/ExpeVector4.cpp
    Math/ExpeColor.cpp
    Math/ExpeQuaternion.cpp
    Math/ExpeMatrix3.cpp
    Math/ExpeMatrix4.cpp
    Math/ExpeAxisAlignedBox.cpp
    
    ExpeTypedObject.cpp
    ExpeStringHelper.cpp
    ExpeLogManager.cpp
    ExpeSmartCast.cpp
    ExpeLazzyUi.cpp
    ExpeOptions.cpp
    
    ExpePluginManager.cpp
    
    IO/ExpeSerializableObject.cpp
    IO/ExpeIOManager.cpp
    IO/ExpeReader.cpp
    IO/ExpeWriter.cpp
    
    ExpeStaticInitializer.cpp
    ExpeApplication.cpp
)

if (GSL_FOUND)
set (ExpeCore_src ${ExpeCore_src} Math/ExpeLinearAlgebra.cpp)
ENDIF (GSL_FOUND)

# tell cmake to create .moc files for all files in the variable qtproject_SRCS that require such a file.
# note: this assumes that you use #include "header.moc" in your files
qt4_automoc( ${ExpeCore_src} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# create an executable file named "qtproject" from the source files in the variable "qtproject_SRCS".
add_library(ExpeCore SHARED ${ExpeCore_src})

ADD_PRECOMPILED_HEADER(ExpeCore ExpeCorePCH.h true)

# link the "qtproject" target against the Qt libraries. which libraries exactly, is defined by the "include(${QT_USE_FILE})" line above, which sets up this variable.
target_link_libraries(ExpeCore ${QT_LIBRARIES} ${OCTAVE_LIBRARIES} ${GSL_LIBRARIES})

if (EXPE_BUILD_TESTS)
    add_subdirectory(Tests)
endif (EXPE_BUILD_TESTS)

